<template>
  <div class="home">
    <el-card>
      <img id="avatar" :src="userStore.avatar" alt="" />
      <div class="bottom">
        <h3 class="title">{{ `Hi${getTime()}好，${userStore.username}` }}</h3>
        <p class="subtitle">欢迎登录后台管理系统平台</p>
      </div>
    </el-card>
    <div class="bottoms">
      <svg-icon name="welcome" width="600px" height="300px"></svg-icon>
    </div>
  </div>
</template>
<script setup>
import { onMounted } from 'vue'
import { getTime } from '@/utils/time.ts'
// 引入用户信息相关仓库
import useUserStore from '@/store/modules/user.ts'
let userStore = useUserStore()
onMounted(() => {})
</script>
<style lang="scss" scoped>
.home {
  .el-card {
    // 使用:deep进行样式穿透处理
    :deep(.el-card__body) {
      display: flex;
      align-items: center;
    }
    #avatar {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      margin-right: 20px;
    }
  }
  .bottom {
    .title {
      font-size: 30px;
      font-weight: 900;
      margin-bottom: 30px;
    }
    .subtitle {
      font-style: italic;
      color: skyblue;
    }
  }
  .bottoms {
    margin-top: 160px;
    display: flex;
    justify-content: center;
  }
}
</style>
